/*
Document   : util
Created on : Oct 28, 2009, 2:58:36 PM
Author     : fdcube
 */
var ajax = function() {}
ajax.prototype.GetInstance = function() {
    xmlr = false;
    try{
        xmlr = new ActiveXObject("Msxml2.XMLHTTP");
    }catch (e){
        try{
            xmlr = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e){
            xmlr = false;
        }
    }
    if (!xmlr && typeof XMLHttpRequest!='undefined'){
        xmlr = new XMLHttpRequest();
    }
    return xmlr;
}
ajax.prototype.AbortSend = function(ins) {
    if (ins.readyState != 0) {
        ins.abort();
    }
}
ajax.prototype.DoPost = function(content,callback){
    ins = this.GetInstance();
    ins.open("POST","/",true);
    ins.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    ins.send(content);
    ins.onreadystatechange = callback;
    return ins;
}